<?php
require_once __DIR__ . '/../../autoload.php';
require_once __DIR__ . '/../testNotify.php';

use Payment\Common\PayException;
use Payment\Client\Notify;
use Payment\Config;

date_default_timezone_set('Asia/Shanghai');

$config = require_once __DIR__ . '/transferConfig.php';

$_POST['req'] = [
    'sign' => '34856bef9cc8c19e93010d912661f886276b949f4d033854c0f2aaf2ecbd5a9d025195cc5c6a8ae61801e4dbc33757201a09e0d3f46d00a7e4d27bca07697dc7d6b3a4e1a573a88bc0d74f6ca6ac57710aed4bbd6566261a48deb8c7ddbe1b0aca448347378a589b276b0a926726f3617f3131c2dc2add7d57bf6f05037f4bd14a07ff256fb06decbad159ec8f60611bc9b1133c63334159b847950c505d78ad410d9e273f5ea8f915efe339a46c5d2edf472db46a7a69aaa7c528d90e4fe0cbb50bbfb882b627bb0bcf663960bd3a412ca264914cd3844ca415097e051bad8e9531dbcd46eef5c06b06cf23b331a2ee3345e59c9c1b336b4d348feb241fbb356453adb98075c72929e1933d14cc2fa1e1740c4f906b5ec3cd71887c4448ebebfec0b67a77d4469ac23648f9195acc1749a86cf1e455904f8f01d8ac4e787f607d74b055c82989277ddbd1a7b31110e0a5adc20757181895eaf671bdc19eac5e887333edf2487a94c58408c012754310451b3924becbcaed999059eda07cc6d15b6580dd31a714ec38be9cc3b9c1220ffd93292d86b533ad1b38625253bcb717ab02a44d333ba72ad301323c3e49a93268503d2a44c211926d9103615c4b552a803839993e428d332347f1b1b657656eba00a08616a14a11e4e57b2fb0aad12e0103b9a1ed714de8b7f39fd5caaab38d0405f93643cf7d0b4f034f5f90859d886614a576a27421c9a62c2aaef0b6a9ed2b0db3d1f1736cddd3e23ab53fb710e558122cfde4c32e803c00aa32ef0f5e362e7119f856661fca83af68aa5ca671dd923c55731bfcc1d51e748049545a6e4abf26b4096261ecc5dd9a0ea071592aaac4864f06dce9f817ce5bce846ca509a48189439a7a2e401bbc50801742bad27c',
];

try {
    $ret = Notify::run(Config::HSQ_TRANSFER, $config, new TestNotify());
    var_dump($ret);
} catch (PayException $e) {
    echo $e->errorMessage();
}